-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(e2e): tolerate revert message in both error and status message #2983
Conversation
248e9f8
to
749c2ec
Compare
📝 WalkthroughWalkthroughThe changes in this pull request enhance the error handling logic within two end-to-end test functions: Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
e2e/e2etests/test_solana_deposit_refund.go (1)
35-40
: Approve changes with suggestions for improvementThe modifications effectively address the PR objective by introducing more flexible error message validation. The code now tolerates revert messages in both the
ErrorMessage
andStatusMessage
fields, which aligns with the goal of improving the robustness of the upgrade tests.However, there are two areas where the implementation could be further enhanced:
Consistency in error messages: The code checks for different error messages in
ErrorMessage
("revert executed") andStatusMessage
(utils.ErrHashRevertFoo). Consider standardizing these messages for better maintainability.Debugging information: To facilitate easier troubleshooting, consider adding logging statements to indicate which condition was met.
Here's a suggested refactoring that addresses these points:
const revertMessage = "revert executed" if cctx.CctxStatus.ErrorMessage != "" { r.Logger.Debug("Revert found in ErrorMessage") require.Contains(r, cctx.CctxStatus.ErrorMessage, revertMessage) } else { r.Logger.Debug("Revert found in StatusMessage") require.Contains(r, cctx.CctxStatus.StatusMessage, revertMessage) }This refactoring introduces a constant for the revert message, ensuring consistency across both checks, and adds logging statements to aid in debugging.
e2e/e2etests/test_eth_deposit_call.go (1)
91-96
: Approve changes with minor improvement suggestions.The modifications effectively address the PR objective of tolerating revert messages in both error and status messages, enhancing the test's robustness. However, I propose the following refinements:
- For consistency, consider using the same error message check for both fields:
revertMessage := "revert executed" if cctx.CctxStatus.ErrorMessage != "" { require.Contains(r, cctx.CctxStatus.ErrorMessage, revertMessage) } else { require.Contains(r, cctx.CctxStatus.StatusMessage, revertMessage) }
- Add a comment explaining the rationale behind checking two different fields:
// Check for revert message in ErrorMessage first, then in StatusMessage // This accommodates potential differences in error reporting between versionsThese suggestions aim to improve code consistency and clarity while maintaining the intended functionality.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- e2e/e2etests/test_eth_deposit_call.go (1 hunks)
- e2e/e2etests/test_solana_deposit_refund.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
e2e/e2etests/test_eth_deposit_call.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.e2e/e2etests/test_solana_deposit_refund.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
Description
Fix the upgrade tests.
Closes #2982
E2E is failing with:
How Has This Been Tested?
Summary by CodeRabbit
Bug Fixes
Tests